home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CreatingGames / Utilities / Misc / GMS / GMSDev / Source / Asm / Chunky / ChunkyPicture.s < prev    next >
Encoding:
Text File  |  1997-12-15  |  2.5 KB  |  110 lines

  1. ;-------T-------T------------------------T----------------------------------;
  2. ;Name:      Chunky Picture
  3. ;Author:    Paul Manias
  4. ;Copyright: DreamWorld Productions (c) 1996-1997.  Freely distributable.
  5. ;
  6. ;This demo loads in a picture in chunky format and then calls RefreshScreen()
  7. ;to do the C2P conversion.
  8.  
  9.     INCDIR    "INCLUDES:"
  10.     INCLUDE    "dpkernel/dpkernel.i"
  11.  
  12. ;===========================================================================;
  13. ;                             INITIALISE DEMO
  14. ;===========================================================================;
  15.  
  16.     SECTION    "Demo",CODE
  17.  
  18.     STARTDPK
  19.  
  20. Start:    MOVEM.L    A0-A6/D1-D7,-(SP)
  21.     move.l    DPKBase(pc),a6
  22.     lea    ScreenTags(pc),a0
  23.     sub.l    a1,a1
  24.     CALL    Init
  25.     tst.l    d0
  26.     beq.s    .Exit
  27.  
  28.     ;Load the picture.
  29.  
  30.     move.l    Screen(pc),a1
  31.     move.l    GS_MemPtr1(a1),PicData
  32.     lea    PictureTags(pc),a0
  33.     sub.l    a1,a1
  34.     CALL    Init
  35.     tst.l    d0
  36.     beq.s    .Exit
  37.  
  38.     ;Update palette to that of the picture.
  39.  
  40.     move.l    SCRBase(pc),a6
  41.     move.l    Screen(pc),a0
  42.     move.l    Picture(pc),a1
  43.     move.l    PIC_Palette(a1),GS_Palette(a0)
  44.     CALL    scrUpdatePalette
  45.  
  46.     move.l    DPKBase(pc),a6
  47.     move.l    Screen(pc),a0
  48.     CALL    Display
  49.  
  50.     bsr.s    Main
  51.  
  52. .Exit    move.l    DPKBase(pc),a6
  53.     move.l    Picture(pc),a0
  54.     CALL    Free
  55.     move.l    Screen(pc),a0
  56.     CALL    Free
  57.     MOVEM.L    (SP)+,A0-A6/D1-D7
  58.     moveq    #ERR_OK,d0
  59.     rts
  60.  
  61. ;===========================================================================;
  62. ;                                MAIN LOOP
  63. ;===========================================================================;
  64.  
  65. Main:    move.l    SCRBase(pc),a6
  66.     move.l    Screen(pc),a0
  67.     CALL    scrRefreshScreen
  68.  
  69.     move.l    DPKBase(pc),a6
  70.     moveq    #20,d0
  71.     CALL    WaitTime
  72.     rts
  73.  
  74. ;===========================================================================;
  75. ;                                  DATA
  76. ;===========================================================================;
  77.  
  78. ScreenTags:    dc.l  TAGS_SCREEN
  79. Screen:        dc.l  0
  80.         dc.l  GSA_Width,320
  81.         dc.l  GSA_Height,256
  82.         dc.l    GSA_BitmapTags,0
  83.         dc.l    BMA_Type,CHUNKY8
  84.         dc.l    TAGEND,0
  85.         dc.l  TAGEND
  86.  
  87. PictureTags:    dc.l  TAGS_PICTURE
  88. Picture:    dc.l  0
  89.         dc.l    PCA_BitmapTags,0
  90.         dc.l    BMA_Data
  91. PicData:    dc.l    0
  92.         dc.l    BMA_Width,320
  93.         dc.l    BMA_Height,256
  94.         dc.l    BMA_Type,CHUNKY8
  95.         dc.l    TAGEND,0
  96.         dc.l  PCA_Source,.file
  97.         dc.l  TAGEND
  98.  
  99. .file        FILENAME "GMS:demos/data/PIC.Green"
  100.  
  101. ;===========================================================================;
  102.  
  103. ProgName:    dc.b  "Chunky Picture",0
  104. ProgAuthor:    dc.b  "Paul Manias",0
  105. ProgDate:    dc.b  "10 December 1997",0
  106. ProgCopyright:    dc.b  "DreamWorld Productions (c) 1996-1997.  Freely distributable.",0
  107. ProgShort:    dc.b  "Chunky demonstration.",0
  108.         even
  109.  
  110.